﻿@model GameSchoolApplication.Models.StudentAssignmentPoints

@{
    ViewBag.Title = "Gefa einkunn";
    Layout = "~/Views/Shared/_TeacherLayout.cshtml";
}

<h2>Gefa einkunn fyrir: @Model.Assignment.Title</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@if (Model.Points == null)
{
    using (Html.BeginForm())
    {
    @Html.ValidationSummary(true)
    <fieldset>
        <legend></legend>

        @Html.HiddenFor(model => model.Id)
        @Html.HiddenFor(model => model.AssignmentId)
        @Html.HiddenFor(model => model.StudentId)

        <div class="editor-label">
            @Html.LabelFor(model => model.FileName)
        </div>
        <div>
            @if (Model.FileName != null)
            {
                @Html.ActionLink(Model.FileName, "Download", new { handInId = Model.Id })
            }
            else
            { 
                <p>Nemandi hefur ekki skilað verkefni.</p>
            }
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Points) (Hámark: @Model.Assignment.MaxPoints) 
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Points)
            @Html.ValidationMessageFor(model => model.Points)
        </div>

        <p>
            <input type="submit" value="Staðfesta" />
        </p>
    </fieldset>
    }
}
else
{ 
    <p>Nemandi hefur fengið stigin: @Model.Points</p>
}
<div>
    @Html.ActionLink("Til baka í lista", "Scores", "Game")
</div>
